<?php

$url = $_POST["url"];
if(!$url) $url = $_GET["url"];
if(!$url ) { echo "Empty URL"; exit(0);}

if(preg_match("/\?/", $url)){
	$url.="&encoded=1";
}
else{
	$url.="?encoded=1";
}

$fh=fopen($url, "r");

$str = "";
if($fh){
	while(!feof($fh)){
		$str .= fread($fh, 1024*8); 
	}
}
//$str = mb_convert_encoding( $str , "UTF-8" , "UTF-16");
$str = base64_encode($str);

//echo $str;
//exit(0);

$pass=54;

$newstr = chr($pass);
for($i=0;$i<strlen($str);$i++){
	$newstr.= chr( (ord(substr($str,$i,1)) + $i+1 - 43 +$pass) % 80+43);
}
echo $newstr;


?>
